#include<bits/stdc++.h>
#define all(a) a.begin(), a.end()
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

//std::mt19937 rng {std::chrono::steady_clock::now().time_since_epoch().count()};


int main() {

    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int n, k;
    std::cin >> n >> k;
    std::vector<std::vector<int>> adj(n);
    for (int i = 0; i < n - 1; i++) {
        int u, v;
        std::cin >> u >> v;
        u--;
        v--;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    std::vector<int> v(n);
    for(int i = 0; i < k; i++) {
    	int m;
    	std::cin >> m;
    	m--;
    	v[m] = 1;
    }

    std::vector<int> dp(n);
    int ans = 0;
    auto dfs = [&](auto self, int u, int fa) -> void {

    	dp[u] = v[u];
    	int c = 0;
    	if(v[u]) {
    		c = 2;
    	}
    	for(auto v : adj[u]) {
    		if(v == fa) {
    			continue;
    		}
    		self(self, v, u);
    		dp[u] += dp[v];
    		if(dp[v] > 0) {
    			c++;
    		}
    	}

    	if(dp[u] < k) {
    		c++;
    	}
    	if(c >= 2) {
    		ans++;
    	}

    };

    dfs(dfs, 0, -1);
    std::cout << ans;
    return 0;
}